extends Sprite2D

var _progress:float = 0:
	set(v):
		_progress=clamp(v,0,0.5)
		if _progress==0.5:
			self.visible=false
		else:
			material.set_shader_parameter("time",_progress)
			self.visible=true
func _ready() -> void:
	pass


func _process(delta: float) -> void:
	if self.visible==true:
		_progress=move_toward(_progress,1.0,delta)

func play(global_pos:Vector2) -> void:
	self.global_position=global_pos
	_progress=0.0
